
export default{
  computed: {
      // 表格中列字段
    columns() {
      return [
        {
          key: "sf_estimationOrderCode",
          title: {
            "zh-CN": "暂估单编码",
            "en-US": "sf_estimationOrderCode",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "if_estimationMonth",
          title: {
            "zh-CN": "暂估月份",
            "en-US": "if_estimationMonth",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "energyEstimation",
          title: {
            "zh-CN": "能源暂估值",
            "en-US": "energyEstimation",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "checkStatus",
          title: {
            "zh-CN": "审批状态",
            "en-US": "checkStatus",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "checker",
          title: {
            "zh-CN": "审批人",
            "en-US": "checker",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
          render: (h, params) => {
            return h("div", {}, this.getPersonName(params.row.checker));
          },
        },
        {
          key: "checkTime",
          title: {
            "zh-CN": "审批时间",
            "en-US": "checkTime",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "createdBy",
          title: {
            "zh-CN": "创建人账号",
            "en-US": "created by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "createTime",
          title: {
            "zh-CN": "创建时间",
            "en-US": "create time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updatedBy",
          title: {
            "zh-CN": "修改人账号",
            "en-US": "updated by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updateTime",
          title: {
            "zh-CN": "修改时间",
            "en-US": "update time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
      ];
    },
      // form中列字段
    formColumns() {
      return [
        {
          key: "sf_estimationOrderCode",
          title: {
            "zh-CN": "暂估单编码",
            "en-US": "sf_estimationOrderCode",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "" },
        },
        {
          key: "if_estimationMonth",
          title: {
            "zh-CN": "暂估月份",
            "en-US": "if_estimationMonth",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "" },
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
      ];
    },
    //仪表暂估值form列动态字段
    formMeterColumns() {
      let formMeterColumns = [];
      this.meterEstimation.forEach((d) => {
        formMeterColumns.push({
          key: String(d.id),
          title: {
            "zh-CN": `${d.label}暂估值`,
            "en-US": "meterEstimation",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "number" },
        });
      });
      return formMeterColumns;
    },
    // 新增form中列字段（去掉能源暂估值）
    addFormColumns() {
      return [
        {
          key: "sf_estimationOrderCode",
          title: {
            "zh-CN": "暂估单编码",
            "en-US": "sf_estimationOrderCode",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "if_estimationMonth",
          title: {
            "zh-CN": "暂估月份",
            "en-US": "if_estimationMonth",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
      ];
    },
    queryFormItem() {
      return [
        {
          key: "sf_estimationOrderCode",
          title: {
            "zh-CN": "暂估单编码",
            "en-US": "sf_estimationOrderCode",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "if_estimationMonth",
          title: {
            "zh-CN": "暂估月份",
            "en-US": "if_estimationMonth",
          }[this.G_Locale],
          config: {
            type: "number",
          },
        },
      ];
    },
    collapseFormItem() {
      return [
        {
          key: "sf_estimationOrderCode",
          title: {
            "zh-CN": "暂估单编码",
            "en-US": "sf_estimationOrderCode",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "if_estimationMonth",
          title: {
            "zh-CN": "暂估月份",
            "en-US": "if_estimationMonth",
          }[this.G_Locale],
          config: {
            type: "number",
          },
        },
      ];
    },
    lang() {
      return {
        "en-US": {
          cancel: "cancel",
          confirmDelete: "confirm delete?",
          status: "status",
          confirmChange: "confirmChange",
          confirmReview: "confirmReview",
          confirmReverseReview: "confirmReverseReview",
        },
        "zh-CN": {
          cancel: "取消",
          confirmDelete: "确认删除？",
          status: "状态",
          confirmChange: "确认修改？",
          confirmReview: "确认审核？",
          confirmReverseReview: "确认反审？",
        },
      }[this.G_Locale];
    },
  },
}
